getText if kullanımı
31.01.2016 - 12:06
TextView text = (TextView)findViewById(R.id.yazi);
String x = text.getText().toString();
if (x=="hata") {
Toast.makeText(getApplicationContext(), "hata", Toast.LENGTH_LONG).show();
}
TextView text = (TextView)findViewById(R.id.postOutput);
String x = text.getText().toString();
if ("hata".equals(x)){
Toast.makeText(getApplicationContext(), "hata", Toast.LENGTH_LONG).show();
}
İki şekildede olmuyor Textviev de hata yazıyorsa toast çalışmasını istiyorum ama if yapısını yanlış yazıyorum hata veriyor.
358
Görüntülenme
0 Beğeni